%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Returns the fundamental matrix   %
%  F through multiple (more than 8) %
%  correspondence points.           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function F = FfromA(A)
    [~, ~, Vt] = svd(A); %will compute the singular value decomposition of A
                         %A has normalized vectors!
    f = Vt(:,9);%takes the eigenvetor corresponding to the smallest singular value, will always be the 9th columns
    F1 = reshape(f,3,3)';%will reshape the solution vector into its correct form

    [U2, Sig2, Vt2] = svd(F1);%decomposes the solution F1 so that we ensure the internal restriction
    F = U2*diag([Sig2(1,1) Sig2(2,2) 0])*Vt2';%restriction imposed
    
    
    



